﻿namespace iOSClub.App.Share;

[Serializable]
public class ProjectModel
{
    public string DepartmentName { get; init; } = "";
    public string Title { get; set; } = "";

    public string Id { get; set; } = "";

    public string Description { get; set; } = "";
    public string? StartTime { get; set; }
    public string? EndTime { get; set; }

    public void Update(ProjectModel model)
    {
        if (!string.IsNullOrEmpty(model.Title)) Title = model.Title;
        if (!string.IsNullOrEmpty(model.Description)) Description = model.Description;
        if (!string.IsNullOrEmpty(model.StartTime)) StartTime = model.StartTime;
        if (!string.IsNullOrEmpty(model.EndTime)) EndTime = model.EndTime;
    }

    public List<StaffModel> Staffs { get; init; } = [];
    public List<TaskModel> Tasks { get; init; } = [];

    public ProjectModel Clone()
    {
        return (ProjectModel)MemberwiseClone();
    }
}